package test.algos.multiply;

import java.util.List;

public class GaussMultiply {

	public Long multiply(Long number1, Long number2) {

		double maxLen = MultUtil.maxTenPos(number1, number2);

		List<Long> digits1 = MultUtil.extractDigits(number1, maxLen);
		List<Long> digits2 = MultUtil.extractDigits(number2, maxLen);

		GaussCoeffs gaussCoefficients = new GaussCoeffs(digits1, digits2);
		gaussCoefficients.computeCoeffs();

		return MultUtil.gaussFormula(gaussCoefficients.getFirstCoeff(),
				gaussCoefficients.getSecondCoeff(),
				gaussCoefficients.getThirdCoeff(), digits1.size());
	}

}
